﻿<%@ Page Title="instore" Language="C#" MasterPageFile="~/MasterPage.master" EnableEventValidation = "false" AutoEventWireup="true" CodeBehind="List.aspx.cs" Inherits="dzs.Web.instore.List" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script language="javascript" src="/js/CheckBox.js" type="text/javascript"></script>
    <script src="../../My97DatePicker/WdatePicker.js"></script>
     <link href="../../jquery-ui.min.css" rel="stylesheet" />
    <script src="../../js/jquery.js"></script>
    <script src="../../js/jquery-ui.min.js"></script>
     <script type="text/javascript">
         $(function () {
             $("#<%# txtpro.ClientID%>").autocomplete({
                 minLength: 2, // 设置搜索的关键字最小长度// 设置自动完成列表的函数，函数包括两个参数，requset和response      
                 source: function (request, response) {
                     $.ajax({
                         type: "POST",          // 通过request.term可以获得文本框内容   
                         url: "../../Handler.ashx?keyword=" + request.term,
                         contentType: "application/json; charset=gb2312",
                         dataType: "json",
                         success: function (data) {
                             // jQuery.map(array, callback) :将一个数组中的元素转换到另一个数组中。
                             //  下面就是把数组["value1", "value2",...]转换为[{value:"value1"}, {value:"value2"},...]                 
                             response($.map(data, function (item) {
                                 return { value: item };
                             }));
                         },
                         error: function () {
                             alert("ajax请求失败");
                         }
                     });
                 }
             });
         });

         function showQRC(iid) {

             window.open('../../PrintQCR.aspx?id='+iid+"&type=ins", 'newwindow', 'height=600, width=400, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no')       
         }
         </script>
    <style type="text/css">
        .auto-style1 {
            width: 1175px;
        }
        .auto-style2 {
            width: 235px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

<!--Title -->

            <!--Title end -->

            <!--Add  -->

            <!--Add end -->

            <!--Search -->
            <table style="width: 100%;" cellpadding="2" cellspacing="1" class="border">
                <tr>
                    <td style="width: 80px" align="right" class="tdbg">
                         <b>日期：</b>
                    </td>
                    <td class="auto-style1">                       
                        <asp:DropDownList ID="ddldate" runat="server">
                            <asp:ListItem Value="=">等于</asp:ListItem>
                            <asp:ListItem Value="&gt;">大于</asp:ListItem>
                            <asp:ListItem Value="&lt;">小于</asp:ListItem>
                        </asp:DropDownList>
                    <asp:TextBox ID="txtKeyword" runat="server" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true})" Width="89px"></asp:TextBox>
                    &nbsp;项目名称：<asp:TextBox ID="txtpro" runat="server"></asp:TextBox>
                        供应商：<asp:TextBox ID="txtgys" runat="server"></asp:TextBox>
                        &nbsp;物料：<asp:TextBox ID="txtwl" runat="server"></asp:TextBox>
                                            
                    </td>
                    <td class="auto-style2">                       
                    <asp:Button ID="btnSearch" runat="server" Text="查询"  OnClick="btnSearch_Click" >
                    </asp:Button>                    
                        
                    </td>
                    <td class="tdbg">
                    </td>
                </tr>
            </table>
            <!--Search end-->
            <br />
            <asp:GridView ID="gridView" runat="server" AllowPaging="True" Width="100%"  OnPageIndexChanging ="gridView_PageIndexChanging"
                    BorderWidth="0px" CellPadding="0" CellSpacing="1" CssClass="gv" GridLines="None" OnRowDataBound="gridView_RowDataBound"
                    AutoGenerateColumns="False"  RowStyle-HorizontalAlign="Center" PageSize="20" DataKeyNames="iid" OnRowCommand="gridView_RowCommand">
                    <Columns>
                            
		                <asp:TemplateField HeaderText="操作">
                            <ItemTemplate>
                               <%-- <asp:HyperLink ID="hy_qcr" runat="server" ForeColor="Blue" 
                                    NavigateUrl='<%# " ../../PrintQCR.aspx?iid="+Eval("iid") %>'>生成二维码</asp:HyperLink>--%>
                                <a href="javascript:showQRC(<%# Eval("iid") %>)" style=" color:Blue">生成二维码 </a>  &nbsp; &nbsp;
                                 <asp:ImageButton ID="btncdel" runat="server" ImageUrl="~/Admin/images/top_3.gif" CommandName="delc" />
                            </ItemTemplate>
                        </asp:TemplateField>
                            
		<asp:BoundField DataField="spname" HeaderText="仓位名" SortExpression="mid" ItemStyle-HorizontalAlign="Center"  > 
<ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:BoundField>
		<asp:BoundField DataField="proid" HeaderText="项目编号" SortExpression="spid" ItemStyle-HorizontalAlign="Center"  > 
<ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:BoundField>
		<asp:BoundField DataField="usework" HeaderText="需用单位" SortExpression="uid" ItemStyle-HorizontalAlign="Center"  > 
<ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:BoundField>
		<asp:BoundField DataField="projectname" HeaderText="项目名" SortExpression="intime" ItemStyle-HorizontalAlign="Center"  > 
<ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:BoundField>
                        <asp:BoundField DataField="material" HeaderText="物料名" />
		<asp:BoundField DataField="projecttype" HeaderText="项目类型" SortExpression="innum" ItemStyle-HorizontalAlign="Center"  > 
                            
<ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:BoundField>
                        <asp:BoundField DataField="supplier" HeaderText="供应商" />
                        <asp:BoundField DataField="intime" HeaderText="入库时间" />
                        <asp:BoundField DataField="innum" HeaderText="入库量" />                        
                        </Columns>
                <PagerStyle CssClass="mypager" />
<RowStyle HorizontalAlign="Center"></RowStyle>
                </asp:GridView>
               <table border="0" cellpadding="0" cellspacing="1" style="width: 100%;">
                <tr>
                    <td style="width: 1px;">                        
                    </td>
                    <td align="left">
                        <asp:Button ID="btnout" runat="server" OnClick="btnout_Click" Text="导出" />
                    </td>
                </tr>
            </table>
</asp:Content>
<%--<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceCheckright" runat="server">
</asp:Content>--%>
